<?php
/**
 * FileManager.php
 * Author: luoji (867404364@qq.com)
 * Date: 2020-12-25
 * Time: 11:18
 */

namespace App\Http\Controllers\Tool;


use App\Http\Controllers\Base;
use App\Tables;

class FileManager extends Base
{
    public function getCustomerList()
    {
        $key = $this->request->get('key');
        if($key !== env('REQ_KEY') and env('REQ_KEY') != null) {
            abort(404);
        }

        $all = Tables\Customer::all();
        $r = [];
        foreach($all as $v) {
            $r[] = [
                'name' => $v['name'],
                'pyCode' => $v['py_code']
            ];
        }
        return response()->json($r);
    }

}